<HTML> 
<HEAD> 
	<TITLE>3rd Party ROBOTC Drivers</TITLE> 
<link href="tabs.css" rel="stylesheet" type="text/css"/> 
<link href="doxygen.css" rel="stylesheet" type="text/css"/> 
</HEAD> 
 
<BODY bgcolor="#ffffff" link="#000000" vlink="#000000"> 
<table width="100%" bgcolor="navy" cellspacing=0 cellpadding=1 border=0> 
<tr><td><table width="100%" bgcolor="#EEEEDD" cellspacing=0 cellpadding=3 border=0> 
<tr> 
    <td width="33%" align="left"> <img src="images/LOGO_NXT.gif" width=266 height=44 border="0" alt="Mindstorms"></td> 
    <td><b><font size="+3" color="navy">3rd Party ROBOTC Drivers</font></b></td> 
    <td align="right"> <img src="images/logo.png" width=44 height=44 border="0" alt="RobotC"></td>     
</tr> 
  <tr bgcolor="#cccc99" align="right"> 
          <td colspan=3> <font face="arial" size="-1"> [<a href=main.html>Home</a>] [<a target=_top href="https://sourceforge.net/projects/rdpartyrobotcdr/">Download</a>] [<a target=_top href="http://apps.sourceforge.net/mantisbt/rdpartyrobotcdr/my_view_page.php">Submit a bug/suggestion</a>]  [<a target=_top href="http://www.robotc.net/forums/">ROBOTC Forums</a>] [<a target=_top href="http://botbench.com">Blog</a>] [<a target=_top href="http://sourceforge.net/donate/index.php?group_id=257238">Support this project</a>]</font> </td> 
</tr> 
</table></td></tr> 
</table> 
<!-- Generated by Doxygen 1.7.2 -->
<div class="header">
  <div class="summary">
<a href="#define-members">Defines</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle">
<h1>hitechnic-irlink.h File Reference</h1>  </div>
</div>
<div class="contents">

<p>HiTechnic IR Link Sensor driver.  
<a href="#_details">More...</a></p>
<code>#include &quot;<a class="el" href="common_8h_source.html">common.h</a>&quot;</code><br/>

<p><a href="hitechnic-irlink_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__htirl.html#ga9f0115a31d1a380b72d67a2dfa1b512d">BUF_HEADSIZE</a>&#160;&#160;&#160;3</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__htirl.html#ga91b88040238ff376ea9ede8045ab1213">BUF_DATASIZE</a>&#160;&#160;&#160;11</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__htirl.html#gae280edca9b8c3437de1ebcc82ee76a85">BUF_TAILSIZE</a>&#160;&#160;&#160;3</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__htirl.html#ga68b7b0075c1695448ef9d091bf870a1f">START_HEAD</a>&#160;&#160;&#160;0</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__htirl.html#gaf58e8696eec8cb522925bf02c3d37a53">START_DATA</a>&#160;&#160;&#160;3</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__htirl.html#gaa0ad6a524fc050e5d5e65982c34843c2">START_TAIL</a>&#160;&#160;&#160;15</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__htirl.html#ga84c7ad37ee371a9ea844c826d2a9756f">PFSPORT</a>(X)&#160;&#160;&#160;X / 8</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__htirl.html#ga201d65aeab944a1f9c9d07e7b575ef96">PFCHAN</a>(X)&#160;&#160;&#160;(X % 8) / 2</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__htirl.html#ga47db229cf1be8ea6ea7b13c9c1d5ecb3">PFMOT</a>(X)&#160;&#160;&#160;X % 2</td></tr>
<tr><td colspan="2"><h2><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__htirl.html#ga39dc14fd7972d5ad5fddd8cd1a62fd5b">tPFmotor</a> { <br/>
&#160;&#160;<a class="el" href="group__htirl.html#gga39dc14fd7972d5ad5fddd8cd1a62fd5ba7494aff8c386091c4ff989e7a369b201">pfmotor_S1_C1_A</a> =  0, 
<a class="el" href="group__htirl.html#gga39dc14fd7972d5ad5fddd8cd1a62fd5bad0dcdc02cb2762dc4d1317325cdbd17f">pfmotor_S1_C1_B</a>, 
<a class="el" href="group__htirl.html#gga39dc14fd7972d5ad5fddd8cd1a62fd5ba29322c15c07fd45b7ff632c263c4429f">pfmotor_S1_C2_A</a>, 
<a class="el" href="group__htirl.html#gga39dc14fd7972d5ad5fddd8cd1a62fd5ba2744d4c431475503f0033979346356a4">pfmotor_S1_C2_B</a>, 
<br/>
&#160;&#160;<a class="el" href="group__htirl.html#gga39dc14fd7972d5ad5fddd8cd1a62fd5babdc968dd53b711112e355b0ae800440e">pfmotor_S1_C3_A</a>, 
<a class="el" href="group__htirl.html#gga39dc14fd7972d5ad5fddd8cd1a62fd5badc84de12ae026e9a3a3ea3996dceeab2">pfmotor_S1_C3_B</a>, 
<a class="el" href="group__htirl.html#gga39dc14fd7972d5ad5fddd8cd1a62fd5ba7568dae041b781630375b4a08696d6f3">pfmotor_S1_C4_A</a>, 
<a class="el" href="group__htirl.html#gga39dc14fd7972d5ad5fddd8cd1a62fd5bafd9cb57f3159a8a6162ef96ef2557bb5">pfmotor_S1_C4_B</a>, 
<br/>
&#160;&#160;<a class="el" href="group__htirl.html#gga39dc14fd7972d5ad5fddd8cd1a62fd5bacfee47ae3f4e8751577fe86e0fddcd7d">pfmotor_S2_C1_A</a>, 
<a class="el" href="group__htirl.html#gga39dc14fd7972d5ad5fddd8cd1a62fd5baffb8a078a5cac436675b8b23cdaabf8a">pfmotor_S2_C1_B</a>, 
<a class="el" href="group__htirl.html#gga39dc14fd7972d5ad5fddd8cd1a62fd5ba33471e39048464bd2ece186b51db955e">pfmotor_S2_C2_A</a>, 
<a class="el" href="group__htirl.html#gga39dc14fd7972d5ad5fddd8cd1a62fd5bab68086ae88b5bd70530c08f593818022">pfmotor_S2_C2_B</a>, 
<br/>
&#160;&#160;<a class="el" href="group__htirl.html#gga39dc14fd7972d5ad5fddd8cd1a62fd5ba0c1d994ed0033f8df728718db8c03b9c">pfmotor_S2_C3_A</a>, 
<a class="el" href="group__htirl.html#gga39dc14fd7972d5ad5fddd8cd1a62fd5baf4b0b20b0aa4a463174ab2d67e8121e5">pfmotor_S2_C3_B</a>, 
<a class="el" href="group__htirl.html#gga39dc14fd7972d5ad5fddd8cd1a62fd5baa547d63294747568687163e7075fdcd4">pfmotor_S2_C4_A</a>, 
<a class="el" href="group__htirl.html#gga39dc14fd7972d5ad5fddd8cd1a62fd5ba64a3ba85222ab2b5d294071f4bbae2c4">pfmotor_S2_C4_B</a>, 
<br/>
&#160;&#160;<a class="el" href="group__htirl.html#gga39dc14fd7972d5ad5fddd8cd1a62fd5ba22c2ed3c04fe670fa4338c68cd04b437">pfmotor_S3_C1_A</a>, 
<a class="el" href="group__htirl.html#gga39dc14fd7972d5ad5fddd8cd1a62fd5ba391f635f1a4c0aa8dcd29395e76ec522">pfmotor_S3_C1_B</a>, 
<a class="el" href="group__htirl.html#gga39dc14fd7972d5ad5fddd8cd1a62fd5ba8e33e5e3cf726feedf4457831420f5a2">pfmotor_S3_C2_A</a>, 
<a class="el" href="group__htirl.html#gga39dc14fd7972d5ad5fddd8cd1a62fd5ba5610c932c07851727fc136aabbb2fd3c">pfmotor_S3_C2_B</a>, 
<br/>
&#160;&#160;<a class="el" href="group__htirl.html#gga39dc14fd7972d5ad5fddd8cd1a62fd5bab87fde0d289e909994576af84739283e">pfmotor_S3_C3_A</a>, 
<a class="el" href="group__htirl.html#gga39dc14fd7972d5ad5fddd8cd1a62fd5ba06933ed636f72c271611a306ecfec1a0">pfmotor_S3_C3_B</a>, 
<a class="el" href="group__htirl.html#gga39dc14fd7972d5ad5fddd8cd1a62fd5bac456bc23bd9755c12eda9897147f0500">pfmotor_S3_C4_A</a>, 
<a class="el" href="group__htirl.html#gga39dc14fd7972d5ad5fddd8cd1a62fd5ba655f10b96e343bff5f76f0bd91a55f46">pfmotor_S3_C4_B</a>, 
<br/>
&#160;&#160;<a class="el" href="group__htirl.html#gga39dc14fd7972d5ad5fddd8cd1a62fd5baf15b90fedacae121af68ddb98e3f4558">pfmotor_S4_C1_A</a>, 
<a class="el" href="group__htirl.html#gga39dc14fd7972d5ad5fddd8cd1a62fd5ba501e82b850a81015b1869fed04e3fd36">pfmotor_S4_C1_B</a>, 
<a class="el" href="group__htirl.html#gga39dc14fd7972d5ad5fddd8cd1a62fd5bac8a242589db421feee81b09de4a0d4ec">pfmotor_S4_C2_A</a>, 
<a class="el" href="group__htirl.html#gga39dc14fd7972d5ad5fddd8cd1a62fd5ba209405be5279be6962ad6c7c73524fe9">pfmotor_S4_C2_B</a>, 
<br/>
&#160;&#160;<a class="el" href="group__htirl.html#gga39dc14fd7972d5ad5fddd8cd1a62fd5ba3f892a94e0e5a119eeaf5b5ec8d257f6">pfmotor_S4_C3_A</a>, 
<a class="el" href="group__htirl.html#gga39dc14fd7972d5ad5fddd8cd1a62fd5ba66b5db4e09d5e8948d4eb10f7d039fe0">pfmotor_S4_C3_B</a>, 
<a class="el" href="group__htirl.html#gga39dc14fd7972d5ad5fddd8cd1a62fd5ba41364f5f16bff2ebdb15376003cb2aa2">pfmotor_S4_C4_A</a>, 
<a class="el" href="group__htirl.html#gga39dc14fd7972d5ad5fddd8cd1a62fd5ba6bd5060efa34807f7ef132bf2107cfbd">pfmotor_S4_C4_B</a>
<br/>
 }</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__htirl.html#ga9c3c0063406d1dabd1b18f2b27e83487">ePWMMotorCommand</a> { <br/>
&#160;&#160;<a class="el" href="group__htirl.html#gga9c3c0063406d1dabd1b18f2b27e83487ad737a185468b4a87612a3c73b1941d32">MOTOR_FLOAT</a> =  0, 
<a class="el" href="group__htirl.html#gga9c3c0063406d1dabd1b18f2b27e83487af87735230f59fc26457ac2d0e0c8d500">MOTOR_FWD_PWM_1</a> =  1, 
<a class="el" href="group__htirl.html#gga9c3c0063406d1dabd1b18f2b27e83487a730c42805aa94913d5d18c86fa9a5039">MOTOR_FWD_PWM_2</a> =  2, 
<a class="el" href="group__htirl.html#gga9c3c0063406d1dabd1b18f2b27e83487abeae20711af8dd7b45f07d0078024f32">MOTOR_FWD_PWM_3</a> =  3, 
<br/>
&#160;&#160;<a class="el" href="group__htirl.html#gga9c3c0063406d1dabd1b18f2b27e83487a2803a16c85e95f9d86d7a1ec94d7629e">MOTOR_FWD_PWM_4</a> =  4, 
<a class="el" href="group__htirl.html#gga9c3c0063406d1dabd1b18f2b27e83487a63cdcb2bc07d3a86aa3cf1dee168036f">MOTOR_FWD_PWM_5</a> =  5, 
<a class="el" href="group__htirl.html#gga9c3c0063406d1dabd1b18f2b27e83487adc4cebf765a9810c8dcfb16fb6436fa7">MOTOR_FWD_PWM_6</a> =  6, 
<a class="el" href="group__htirl.html#gga9c3c0063406d1dabd1b18f2b27e83487af9670289acbb72b9d74390cbf1ad71eb">MOTOR_FWD_PWM_7</a> =  7, 
<br/>
&#160;&#160;<a class="el" href="group__htirl.html#gga9c3c0063406d1dabd1b18f2b27e83487a80c01e43e1dbf1cb4d8445f951859530">MOTOR_BRAKE</a> =  8, 
<a class="el" href="group__htirl.html#gga9c3c0063406d1dabd1b18f2b27e83487a9caaf738698a6b80a16194847c67dddb">MOTOR_REV_PWM_7</a> =  9, 
<a class="el" href="group__htirl.html#gga9c3c0063406d1dabd1b18f2b27e83487a82ef50d985b19a44de1e78ff4571fc35">MOTOR_REV_PWM_6</a> =  10, 
<a class="el" href="group__htirl.html#gga9c3c0063406d1dabd1b18f2b27e83487ad0f3e18d5bf3faf0d944405667355d81">MOTOR_REV_PWM_5</a> =  11, 
<br/>
&#160;&#160;<a class="el" href="group__htirl.html#gga9c3c0063406d1dabd1b18f2b27e83487a28f6bf1f50dec769093eabacf22974e7">MOTOR_REV_PWM_4</a> =  12, 
<a class="el" href="group__htirl.html#gga9c3c0063406d1dabd1b18f2b27e83487a87c4344670bad9a2c571bfd3eccb15cb">MOTOR_REV_PWM_3</a> =  13, 
<a class="el" href="group__htirl.html#gga9c3c0063406d1dabd1b18f2b27e83487add955b9434e283d8d6670b088cbbacab">MOTOR_REV_PWM_2</a> =  14, 
<a class="el" href="group__htirl.html#gga9c3c0063406d1dabd1b18f2b27e83487a99dcd5cae4d0936f6b05115d907a4337">MOTOR_REV_PWM_1</a> =  15
<br/>
 }</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__htirl.html#gac9c310f7de4ef728365b829d296d9b34">eCDMMotorCommand</a> { <a class="el" href="group__htirl.html#ggac9c310f7de4ef728365b829d296d9b34a024e0d2e8e929d10ab128e99ffb4d2bf">CDM_MOTOR_FLOAT</a> =  0, 
<a class="el" href="group__htirl.html#ggac9c310f7de4ef728365b829d296d9b34a595bd736267af8fb533b735b9765b601">CDM_MOTOR_FWD</a> =  1, 
<a class="el" href="group__htirl.html#ggac9c310f7de4ef728365b829d296d9b34a9d19050420be57a557a3e063745f2504">CDM_MOTOR_BAK</a> =  2, 
<a class="el" href="group__htirl.html#ggac9c310f7de4ef728365b829d296d9b34a824870df549686104759f89a4398dacd">CDM_MOTOR_BRAKE</a> =  3
 }</td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__htirl.html#ga3f38d6d4421a9e49bd4ea79ebe1012d6">PFcomboDirectMode</a> (tSensors link, int channel, <a class="el" href="group__htirl.html#gac9c310f7de4ef728365b829d296d9b34">eCDMMotorCommand</a> _motorB, <a class="el" href="group__htirl.html#gac9c310f7de4ef728365b829d296d9b34">eCDMMotorCommand</a> _motorA)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__htirl.html#ga9f9d921939a7bcf5ec940d5ad0c2dab2">PFcomboPwmMode</a> (tSensors link, int channel, <a class="el" href="group__htirl.html#ga9c3c0063406d1dabd1b18f2b27e83487">ePWMMotorCommand</a> _motorB, <a class="el" href="group__htirl.html#ga9c3c0063406d1dabd1b18f2b27e83487">ePWMMotorCommand</a> _motorA)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__htirl.html#ga01dcee117740162d7d438dff743ab5a9">encodeBuffer</a> (<a class="el" href="group__common.html#gaa172ef131853460e5b9f5c6db81d30f4">tByteArray</a> &amp;iBuffer, <a class="el" href="group__common.html#gaa172ef131853460e5b9f5c6db81d30f4">tByteArray</a> &amp;oBuffer)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__htirl.html#ga990f903c4954696e33979bc21c4f4b61">transmitIR</a> (tSensors link, <a class="el" href="group__common.html#gaa172ef131853460e5b9f5c6db81d30f4">tByteArray</a> &amp;oBuffer, int channel)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__htirl.html#ga9632dba95881a5247a7d266490a2fdb7">decToBin</a> (int number, int length, string &amp;output)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__htirl.html#ga36b7bd4c3e586f8b215d924a93dd2397">debugIR</a> (<a class="el" href="group__common.html#gaa172ef131853460e5b9f5c6db81d30f4">tByteArray</a> &amp;data)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__htirl.html#ga71ddacfaa98256c678a241bd86b72d21">PFsinglePinOutputMode</a> (tSensors link, ubyte channel, ubyte _motor, <a class="el" href="group__htirl.html#ga9c3c0063406d1dabd1b18f2b27e83487">ePWMMotorCommand</a> _motorCmd)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__htirl.html#ga7dd0cfb4544284046a7528f1c9fb18c5">PFMotor</a> (<a class="el" href="group__htirl.html#ga39dc14fd7972d5ad5fddd8cd1a62fd5b">tPFmotor</a> pfmotor, <a class="el" href="group__htirl.html#ga9c3c0063406d1dabd1b18f2b27e83487">ePWMMotorCommand</a> _motorCmd)</td></tr>
<tr><td colspan="2"><h2><a name="var-members"></a>
Variables</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">byte&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__htirl.html#ga0c81ab0677f80c959ef6da884ac03f55">toggle</a> [4] = {0, 0, 0, 0}</td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>HiTechnic IR Link Sensor driver. </p>
<p><a class="el" href="hitechnic-irlink_8h.html" title="HiTechnic IR Link Sensor driver.">hitechnic-irlink.h</a> provides an API for the HiTechnic IR Link Sensor.</p>
<p>Changelog:</p>
<ul>
<li>1.0: Initial release</li>
<li>1.1: Minor changes</li>
<li>1.2: Rewrite to make use of the new <a class="el" href="common_8h.html" title="Commonly used functions used by drivers.">common.h</a> API</li>
<li>1.3: Clarified port numbering</li>
<li>1.4: Removed inline functions</li>
<li>1.5: Added <a class="el" href="group__htirl.html#ga71ddacfaa98256c678a241bd86b72d21">PFsinglePinOutputMode()</a> functionality to control motors without a timeout<br/>
 Added PFmotor() as a wrapper for <a class="el" href="group__htirl.html#ga71ddacfaa98256c678a241bd86b72d21">PFsinglePinOutputMode()</a><br/>
 eCPMMotorCommand has been replaced with more generic ePWMMotorCommand<br/>
 <a class="el" href="group__htirl.html#ga990f903c4954696e33979bc21c4f4b61">transmitIR()</a> now works according to the specs<br/>
</li>
</ul>
<p>Credits:</p>
<ul>
<li>Big thanks to HiTechnic for providing me with the hardware necessary to write and test this.</li>
</ul>
<p>License: You may use this code as you wish, provided you give credit where its due.</p>
<p>THIS CODE WILL ONLY WORK WITH ROBOTC VERSION 3.59 AND HIGHER.</p>
<dl class="author"><dt><b>Author:</b></dt><dd>Xander Soldaat (xander_at_botbench.com) </dd></dl>
<dl class="date"><dt><b>Date:</b></dt><dd>25 May 2010 </dd></dl>
<dl class="version"><dt><b>Version:</b></dt><dd>1.4 </dd></dl>

<p>Definition in file <a class="el" href="hitechnic-irlink_8h_source.html">hitechnic-irlink.h</a>.</p>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Wed Mar 13 2013 19:56:43 for ROBOTC Drivers by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.2 </small></address>
</body>
</html>
